package time;

public class LogicalClock {
	private LogicalTimeStamp t;
	
	public LogicalClock(int p){
		t = new LogicalTimeStamp(p);
	}
	
	public LogicalTimeStamp timestampNextEvent(){
		t.increment();
		return t;
	}
	
	public LogicalTimeStamp getTimeStamp(){
		return t.clone();
	}

	public LogicalTimeStamp updateUponReceive(LogicalTimeStamp msg_ts){
		this.t.increment(msg_ts);
		return this.t;
	}

	public void initialize(int pos, int numHosts) {
		((LogicalTimeStamp)t).initialize(pos);
	}
}
